<?php
/**
 *抽奖
 * wsl
 * 2022/7/17
 */
namespace App\Http\Controllers\api;

use App\Http\Controllers\Controller;
use App\Http\Service\LotteryService;
use App\Repository\RepositoryInterface\LotteryInterface;
use Illuminate\Http\Request;

class LotteryController extends Controller
{
    //
    protected $lottery;

    public function __construct(LotteryInterface $lottery){
        $this->lottery = $lottery;
    }

    /**
     * @return mixed
     * 查询可抽商品
     */
    public function LotteryGoods()
    {
        //查询可抽商品
        $lottery_goods = $this->lottery->lotteryGoods();
        return $lottery_goods;
    }

    /**
     * @return array
     *抽奖
     */
    public function Lottery()
    {
        //查询可抽商品
        $lottery_goods = $this->lottery->lotteryGoods();
        //抽奖
        return LotteryService::Lottery($lottery_goods);
    }
}
